home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / program / gmp202.zip / gmp.info-2 (.txt) < prev    next >
GNU Info File  |  1996-06-06  |  44KB  |  783 lines

  1. This is Info file gmp.info, produced by Makeinfo-1.64 from the input
  2. file gmp.texi.
  3. START-INFO-DIR-ENTRY
  4. * gmp: (gmp.info).               GNU Multiple Precision Arithmetic Library.
  5. END-INFO-DIR-ENTRY
  6.    This file documents GNU MP, a library for arbitrary-precision
  7. arithmetic.
  8.    Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation,
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: gmp.info,  Node: Floating-point Functions,  Next: Low-level Functions,  Prev: Rational Number Functions,  Up: Top
  21. Floating-point Functions
  22. ************************
  23.    This is a description of the *preliminary* interface for
  24. floating-point arithmetic in GNU MP 2.
  25.    The floating-point functions expect arguments of type `mpf_t'.
  26.    The MP floating-point functions have an interface that is similar to
  27. the MP integer functions.  The function prefix for floating-point
  28. operations is `mpf_'.
  29.    There is one significant characteristic of floating-point numbers
  30. that has motivated a difference between this function class and other
  31. MP function classes: the inherent inexactness of floating point
  32. arithmetic.  The user has to specify the precision of each variable.  A
  33. computation that assigns a variable will take place with the precision
  34. of the assigned variable; the precision of variables used as input is
  35. ignored.
  36.    The precision of a calculation is defined as follows: Compute the
  37. requested operation exactly (with "infinite precision"), and truncate
  38. the result to the destination variable precision.  Even if the user has
  39. asked for a very high precision, MP will not calculate with superfluous
  40. digits.  For example, if two low-precision numbers of nearly equal
  41. magnitude are added, the precision of the result will be limited to
  42. what is required to represent the result accurately.
  43.    The MP floating-point functions are *not* intended as a smooth
  44. extension to the IEEE P754 arithmetic.  Specifically, the results
  45. obtained on one computer often differs from the results obtained on a
  46. computer with a different word size.
  47. * Menu:
  48. * Initializing Floats::
  49. * Assigning Floats::
  50. * Simultaneous Float Init & Assign::
  51. * Converting Floats::
  52. * Float Arithmetic::
  53. * Float Comparison::
  54. * I/O of Floats::
  55. * Miscellaneous Float Functions::
  56. File: gmp.info,  Node: Initializing Floats,  Next: Assigning Floats,  Up: Floating-point Functions
  57. Initialization and Assignment Functions
  58. =======================================
  59.  - Function: void mpf_set_default_prec (unsigned long int PREC)
  60.      Set the default precision to be *at least* PREC bits.  All
  61.      subsequent calls to `mpf_init' will use this precision, but
  62.      previously initialized variables are unaffected.
  63.    An `mpf_t' object must be initialized before storing the first value
  64. in it.  The functions `mpf_init' and `mpf_init2' are used for that
  65. purpose.
  66.  - Function: void mpf_init (mpf_t X)
  67.      Initialize X to 0.  Normally, a variable should be initialized
  68.      once only or at least be cleared, using `mpf_clear', between
  69.      initializations.  The precision of X is undefined unless a default
  70.      precision has already been established by a call to
  71.      `mpf_set_default_prec'.
  72.  - Function: void mpf_init2 (mpf_t X, unsigned long int PREC)
  73.      Initialize X to 0 and set its precision to be *at least* PREC
  74.      bits.  Normally, a variable should be initialized once only or at
  75.      least be cleared, using `mpf_clear', between initializations.
  76.  - Function: void mpf_clear (mpf_t X)
  77.      Free the space occupied by X.  Make sure to call this function for
  78.      all `mpf_t' variables when you are done with them.
  79.    Here is an example on how to initialize floating-point variables:
  80.      {
  81.        mpf_t x, y;
  82.        mpf_init (x);            /* use default precision */
  83.        mpf_init2 (y, 256);        /* precision *at least* 256 bits */
  84.        ...
  85.        /* Unless the program is about to exit, do ... */
  86.        mpf_clear (x);
  87.        mpf_clear (y);
  88.      }
  89.    The following three functions are useful for changing the precision
  90. during a calculation.  A typical use would be for adjusting the
  91. precision gradually in iterative algorithms like Newton-Raphson, making
  92. the computation precision closely match the actual accurate part of the
  93. numbers.
  94.  - Function: void mpf_set_prec (mpf_t ROP, unsigned long int PREC)
  95.      Set the precision of ROP to be *at least* PREC bits.  Since
  96.      changing the precision involves calls to `realloc', this routine
  97.      should not be called in a tight loop.
  98.  - Function: unsigned long int mpf_get_prec (mpf_t OP)
  99.      Return the precision actually used for assignments of OP.
  100.  - Function: void mpf_set_prec_raw (mpf_t ROP, unsigned long int PREC)
  101.      Set the precision of ROP to be *at least* PREC bits.  This is a
  102.      low-level function that does not change the allocation.  The PREC
  103.      argument must not be larger that the precision previously returned
  104.      by `mpf_get_prec'.  It is crucial that the precision of ROP is
  105.      ultimately reset to exactly the value returned by `mpf_get_prec'.
  106. File: gmp.info,  Node: Assigning Floats,  Next: Simultaneous Float Init & Assign,  Prev: Initializing Floats,  Up: Floating-point Functions
  107. Assignment Functions
  108. --------------------
  109.    These functions assign new values to already initialized floats
  110. (*note Initializing Floats::.).
  111.  - Function: void mpf_set (mpf_t ROP, mpf_t OP)
  112.  - Function: void mpf_set_ui (mpf_t ROP, unsigned long int OP)
  113.  - Function: void mpf_set_si (mpf_t ROP, signed long int OP)
  114.  - Function: void mpf_set_d (mpf_t ROP, double OP)
  115.  - Function: void mpf_set_z (mpf_t ROP, mpz_t OP)
  116.  - Function: void mpf_set_q (mpf_t ROP, mpq_t OP)
  117.      Set the value of ROP from OP.
  118.  - Function: int mpf_set_str (mpf_t ROP, char *STR, int BASE)
  119.      Set the value of ROP from the string in STR.  The string is of the
  120.      form `M@N' or, if the base is 10 or less, alternatively `MeN'.
  121.      `M' is the mantissa and `N' is the exponent.  The mantissa is
  122.      always in the specified base.  The exponent is either in the
  123.      specified base or, if BASE is negative, in decimal.
  124.      The argument BASE may be in the ranges 2 to 36, or -36 to -2.
  125.      Negative values are used to specify that the exponent is in
  126.      decimal.
  127.      Unlike the corresponding `mpz' function, the base will not be
  128.      determined from the leading characters of the string if BASE is 0.
  129.      This is so that numbers like `0.23' are not interpreted as octal.
  130.      White space is allowed in the string, and is simply ignored.
  131.      This function returns 0 if the entire string up to the '\0' is a
  132.      valid number in base BASE.  Otherwise it returns -1.
  133. File: gmp.info,  Node: Simultaneous Float Init & Assign,  Next: Converting Floats,  Prev: Assigning Floats,  Up: Floating-point Functions
  134. Combined Initialization and Assignment Functions
  135. ------------------------------------------------
  136.    For convenience, MP provides a parallel series of initialize-and-set
  137. functions which initialize the output and then store the value there.
  138. These functions' names have the form `mpf_init_set...'
  139.    Once the float has been initialized by any of the `mpf_init_set...'
  140. functions, it can be used as the source or destination operand for the
  141. ordinary float functions.  Don't use an initialize-and-set function on
  142. a variable already initialized!
  143.  - Function: void mpf_init_set (mpf_t ROP, mpf_t OP)
  144.  - Function: void mpf_init_set_ui (mpf_t ROP, unsigned long int OP)
  145.  - Function: void mpf_init_set_si (mpf_t ROP, signed long int OP)
  146.  - Function: void mpf_init_set_d (mpf_t ROP, double OP)
  147.      Initialize ROP and set its value from OP.
  148.      The precision of ROP will be taken from the active default
  149.      precision, as set by `mpf_set_default_prec'.
  150.  - Function: int mpf_init_set_str (mpf_t ROP, char *STR, int BASE)
  151.      Initialize ROP and set its value from the string in STR.  See
  152.      `mpf_set_str' above for details on the assignment operation.
  153.      Note that ROP is initialized even if an error occurs.  (I.e., you
  154.      have to call `mpf_clear' for it.)
  155.      The precision of ROP will be taken from the active default
  156.      precision, as set by `mpf_set_default_prec'.
  157. File: gmp.info,  Node: Converting Floats,  Next: Float Arithmetic,  Prev: Simultaneous Float Init & Assign,  Up: Floating-point Functions
  158. Conversion Functions
  159. ====================
  160.  - Function: double mpf_get_d (mpf_t OP)
  161.      Convert OP to a double.
  162.  - Function: char * mpf_get_str (char *STR, mp_exp_t *EXPPTR, int BASE,
  163.           size_t N_DIGITS, mpf_t OP)
  164.      Convert OP to a string of digits in base BASE.  The base may vary
  165.      from 2 to 36.  Generate at most N_DIGITS significant digits, or if
  166.      N_DIGITS is 0, the maximum number of digits accurately
  167.      representable by OP.
  168.      If STR is NULL, space for the mantissa is allocated using the
  169.      default allocation function, and a pointer to the string is
  170.      returned.
  171.      If STR is not NULL, it should point to a block of storage enough
  172.      large for the mantissa, i.e., N_DIGITS + 2.  The two extra bytes
  173.      are for a possible minus sign, and for the terminating null
  174.      character.
  175.      The exponent is written through the pointer EXPPTR.
  176.      If N_DIGITS is 0, the maximum number of digits meaningfully
  177.      achievable from the precision of OP will be generated.  Note that
  178.      the space requirements for STR in this case will be impossible for
  179.      the user to predetermine.  Therefore, you need to pass NULL for
  180.      the string argument whenever N_DIGITS is 0.
  181.      The generated string is a fraction, with an implicit radix point
  182.      immediately to the left of the first digit.  For example, the
  183.      number 3.1416 would be returned as "31416" in the string and 1
  184.      written at EXPPTR.
  185. File: gmp.info,  Node: Float Arithmetic,  Next: Float Comparison,  Prev: Converting Floats,  Up: Floating-point Functions
  186. Arithmetic Functions
  187. ====================
  188.  - Function: void mpf_add (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  189.  - Function: void mpf_add_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  190.           OP2)
  191.      Set ROP to OP1 + OP2.
  192.  - Function: void mpf_sub (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  193.  - Function: void mpf_ui_sub (mpf_t ROP, unsigned long int OP1, mpf_t
  194.           OP2)
  195.  - Function: void mpf_sub_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  196.           OP2)
  197.      Set ROP to OP1 - OP2.
  198.  - Function: void mpf_mul (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  199.  - Function: void mpf_mul_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  200.           OP2)
  201.      Set ROP to OP1 times OP2.
  202.    Division is undefined if the divisor is zero, and passing a zero
  203. divisor to the divide functions will make these functions intentionally
  204. divide by zero.  This gives the user the possibility to handle
  205. arithmetic exceptions in these functions in the same manner as other
  206. arithmetic exceptions.
  207.  - Function: void mpf_div (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  208.  - Function: void mpf_ui_div (mpf_t ROP, unsigned long int OP1, mpf_t
  209.           OP2)
  210.  - Function: void mpf_div_ui (mpf_t ROP, mpf_t OP1, unsigned long int
  211.           OP2)
  212.      Set ROP to OP1/OP2.
  213.  - Function: void mpf_sqrt (mpf_t ROP, mpf_t OP)
  214.  - Function: void mpf_sqrt_ui (mpf_t ROP, unsigned long int OP)
  215.      Set ROP to the square root of OP.
  216.  - Function: void mpf_neg (mpf_t ROP, mpf_t OP)
  217.      Set ROP to -OP.
  218.  - Function: void mpf_abs (mpf_t ROP, mpf_t OP)
  219.      Set ROP to the absolute value of OP.
  220.  - Function: void mpf_mul_2exp (mpf_t ROP, mpf_t OP1, unsigned long int
  221.           OP2)
  222.      Set ROP to OP1 times 2 raised to OP2.
  223.  - Function: void mpf_div_2exp (mpf_t ROP, mpf_t OP1, unsigned long int
  224.           OP2)
  225.      Set ROP to OP1 divided by 2 raised to OP2.
  226. File: gmp.info,  Node: Float Comparison,  Next: I/O of Floats,  Prev: Float Arithmetic,  Up: Floating-point Functions
  227. Comparison Functions
  228. ====================
  229.  - Function: int mpf_cmp (mpf_t OP1, mpf_t OP2)
  230.  - Function: int mpf_cmp_ui (mpf_t OP1, unsigned long int OP2)
  231.  - Function: int mpf_cmp_si (mpf_t OP1, signed long int OP2)
  232.      Compare OP1 and OP2.  Return a positive value if OP1 > OP2, zero
  233.      if OP1 = OP2, and a negative value if OP1 < OP2.
  234.  - Function: int mpf_eq (mpf_t OP1, mpf_t OP2, unsigned long int op3)
  235.      Return non-zero if the first OP3 bits of OP1 and OP2 are equal,
  236.      zero otherwise.  I.e., test of OP1 and OP2 are approximately equal.
  237.  - Function: void mpf_reldiff (mpf_t ROP, mpf_t OP1, mpf_t OP2)
  238.      Compute the relative difference between OP1 and OP2 and store the
  239.      result in ROP.
  240.  - Macro: int mpf_sgn (mpf_t OP)
  241.      Return +1 if OP > 0, 0 if OP = 0, and -1 if OP < 0.
  242.      This function is actually implemented as a macro.  It evaluates its
  243.      arguments multiple times.
  244. File: gmp.info,  Node: I/O of Floats,  Next: Miscellaneous Float Functions,  Prev: Float Comparison,  Up: Floating-point Functions
  245. Input and Output Functions
  246. ==========================
  247.    Functions that perform input from a stdio stream, and functions that
  248. output to a stdio stream.  Passing a NULL pointer for a STREAM argument
  249. to any of these functions will make them read from `stdin' and write to
  250. `stdout', respectively.
  251.    When using any of these functions, it is a good idea to include
  252. `stdio.h' before `gmp.h', since that will allow `gmp.h' to define
  253. prototypes for these functions.
  254.  - Function: size_t mpf_out_str (FILE *STREAM, int BASE, size_t
  255.           N_DIGITS, mpf_t OP)
  256.      Output OP on stdio stream STREAM, as a string of digits in base
  257.      BASE.  The base may vary from 2 to 36.  Print at most N_DIGITS
  258.      significant digits, or if N_DIGITS is 0, the maximum number of
  259.      digits accurately representable by OP.
  260.      In addition to the significant digits, a leading `0.' and a
  261.      trailing exponent, in the form `eNNN', are printed.  If BASE is
  262.      greater than 10, `@' will be used instead of `e' as exponent
  263.      delimiter.
  264.      Return the number of bytes written, or if an error occurred,
  265.      return 0.
  266.  - Function: size_t mpf_inp_str (mpf_t ROP, FILE *STREAM, int BASE)
  267.      Input a string in base BASE from stdio stream STREAM, and put the
  268.      read float in ROP.  The string is of the form `M@N' or, if the
  269.      base is 10 or less, alternatively `MeN'.  `M' is the mantissa and
  270.      `N' is the exponent.  The mantissa is always in the specified
  271.      base.  The exponent is either in the specified base or, if BASE is
  272.      negative, in decimal.
  273.      The argument BASE may be in the ranges 2 to 36, or -36 to -2.
  274.      Negative values are used to specify that the exponent is in
  275.      decimal.
  276.      Unlike the corresponding `mpz' function, the base will not be
  277.      determined from the leading characters of the string if BASE is 0.
  278.      This is so that numbers like `0.23' are not interpreted as octal.
  279.      Return the number of bytes read, or if an error occurred, return 0.
  280. File: gmp.info,  Node: Miscellaneous Float Functions,  Prev: I/O of Floats,  Up: Floating-point Functions
  281. Miscellaneous Functions
  282. =======================
  283.  - Function: void mpf_random2 (mpf_t ROP, mp_size_t MAX_SIZE, mp_exp_t
  284.           MAX_EXP)
  285.      Generate a random float of at most MAX_SIZE limbs, with long
  286.      strings of zeros and ones in the binary representation.  The
  287.      exponent of the number is in the interval -EXP to EXP.  This
  288.      function is useful for testing functions and algorithms, since
  289.      this kind of random numbers have proven to be more likely to
  290.      trigger corner-case bugs.  Negative random numbers are generated
  291.      when MAX_SIZE is negative.
  292. File: gmp.info,  Node: Low-level Functions,  Next: BSD Compatible Functions,  Prev: Floating-point Functions,  Up: Top
  293. Low-level Functions
  294. *******************
  295.    This chapter describes low-level MP functions, used to implement the
  296. high-level MP functions, but also intended for time-critical user code.
  297.    These functions start with the prefix `mpn_'.
  298.    The `mpn' functions are designed to be as fast as possible, *not* to
  299. provide a coherent calling interface.  The different functions have
  300. somewhat similar interfaces, but there are variations that make them
  301. hard to use.  These functions do as little as possible apart from the
  302. real multiple precision computation, so that no time is spent on things
  303. that not all callers need.
  304.    A source operand is specified by a pointer to the least significant
  305. limb and a limb count.  A destination operand is specified by just a
  306. pointer.  It is the responsibility of the caller to ensure that the
  307. destination has enough space for storing the result.
  308.    With this way of specifying operands, it is possible to perform
  309. computations on subranges of an argument, and store the result into a
  310. subrange of a destination.
  311.    A common requirement for all functions is that each source area
  312. needs at least one limb.  No size argument may be zero.
  313.    The `mpn' functions is the base for the implementation of the `mpz_',
  314. `mpf_', and `mpq_' functions.
  315.    This example adds the number beginning at SRC1_PTR and the number
  316. beginning at SRC2_PTR and writes the sum at DEST_PTR.  All areas have
  317. SIZE limbs.
  318.      cy = mpn_add_n (dest_ptr, src1_ptr, src2_ptr, size)
  319. In the notation used here, a source operand is identified by the
  320. pointer to the least significant limb, and the limb count in braces.
  321. For example, {s1_ptr, s1_size}.
  322.  - Function: mp_limb_t mpn_add_n (mp_limb_t * DEST_PTR, const mp_limb_t
  323.           * SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  324.      Add {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE}, and write the SIZE
  325.      least significant limbs of the result to DEST_PTR.  Return carry,
  326.      either 0 or 1.
  327.      This is the lowest-level function for addition.  It is the
  328.      preferred function for addition, since it is written in assembly
  329.      for most targets.  For addition of a variable to itself (i.e.,
  330.      SRC1_PTR equals SRC2_PTR, use `mpn_lshift' with a count of 1 for
  331.      optimal speed.
  332.  - Function: mp_limb_t mpn_add_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  333.           * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  334.      Add {SRC1_PTR, SIZE} and SRC2_LIMB, and write the SIZE least
  335.      significant limbs of the result to DEST_PTR.  Return carry, either
  336.      0 or 1.
  337.  - Function: mp_limb_t mpn_add (mp_limb_t * DEST_PTR, const mp_limb_t *
  338.           SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  339.           mp_size_t SRC2_SIZE)
  340.      Add {SRC1_PTR, SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}, and write the
  341.      SRC1_SIZE least significant limbs of the result to DEST_PTR.
  342.      Return carry, either 0 or 1.
  343.      This function requires that SRC1_SIZE is greater than or equal to
  344.      SRC2_SIZE.
  345.  - Function: mp_limb_t mpn_sub_n (mp_limb_t * DEST_PTR, const mp_limb_t
  346.           * SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  347.      Subtract {SRC2_PTR, SRC2_SIZE} from {SRC1_PTR, SIZE}, and write
  348.      the SIZE least significant limbs of the result to DEST_PTR.
  349.      Return borrow, either 0 or 1.
  350.      This is the lowest-level function for subtraction.  It is the
  351.      preferred function for subtraction, since it is written in
  352.      assembly for most targets.
  353.  - Function: mp_limb_t mpn_sub_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  354.           * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  355.      Subtract SRC2_LIMB from {SRC1_PTR, SIZE}, and write the SIZE least
  356.      significant limbs of the result to DEST_PTR.  Return borrow,
  357.      either 0 or 1.
  358.  - Function: mp_limb_t mpn_sub (mp_limb_t * DEST_PTR, const mp_limb_t *
  359.           SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  360.           mp_size_t SRC2_SIZE)
  361.      Subtract {SRC2_PTR, SRC2_SIZE} from {SRC1_PTR, SRC1_SIZE}, and
  362.      write the SRC1_SIZE least significant limbs of the result to
  363.      DEST_PTR.  Return borrow, either 0 or 1.
  364.      This function requires that SRC1_SIZE is greater than or equal to
  365.      SRC2_SIZE.
  366.  - Function: void mpn_mul_n (mp_limb_t * DEST_PTR, const mp_limb_t *
  367.           SRC1_PTR, const mp_limb_t * SRC2_PTR, mp_size_t SIZE)
  368.      Multiply {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE}, and write the
  369.      *entire* result to DEST_PTR.
  370.      The destination has to have space for 2SIZE limbs, even if the
  371.      significant result might be one limb smaller.
  372.  - Function: mp_limb_t mpn_mul_1 (mp_limb_t * DEST_PTR, const mp_limb_t
  373.           * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  374.      Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and write the SIZE least
  375.      significant limbs of the product to DEST_PTR.  Return the most
  376.      significant limb of the product.
  377.      This is a low-level function that is a building block for general
  378.      multiplication as well as other operations in MP.  It is written
  379.      in assembly for most targets.
  380.      Don't call this function if SRC2_LIMB is a power of 2; use
  381.      `mpn_lshift' with a count equal to the logarithm of SRC2_LIMB
  382.      instead, for optimal speed.
  383.  - Function: mp_limb_t mpn_addmul_1 (mp_limb_t * DEST_PTR, const
  384.           mp_limb_t * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  385.      Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and add the SIZE least
  386.      significant limbs of the product to {DEST_PTR, SIZE} and write the
  387.      result to DEST_PTR DEST_PTR.  Return the most significant limb of
  388.      the product, plus carry-out from the addition.
  389.      This is a low-level function that is a building block for general
  390.      multiplication as well as other operations in MP.  It is written
  391.      in assembly for most targets.
  392.  - Function: mp_limb_t mpn_submul_1 (mp_limb_t * DEST_PTR, const
  393.           mp_limb_t * SRC1_PTR, mp_size_t SIZE, mp_limb_t SRC2_LIMB)
  394.      Multiply {SRC1_PTR, SIZE} and SRC2_LIMB, and subtract the SIZE
  395.      least significant limbs of the product from {DEST_PTR, SIZE} and
  396.      write the result to DEST_PTR.  Return the most significant limb of
  397.      the product, minus borrow-out from the subtraction.
  398.      This is a low-level function that is a building block for general
  399.      multiplication and division as well as other operations in MP.  It
  400.      is written in assembly for most targets.
  401.  - Function: mp_limb_t mpn_mul (mp_limb_t * DEST_PTR, const mp_limb_t *
  402.           SRC1_PTR, mp_size_t SRC1_SIZE, const mp_limb_t * SRC2_PTR,
  403.           mp_size_t SRC2_SIZE)
  404.      Multiply {SRC1_PTR, SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}, and
  405.      write the result to DEST_PTR.  Return the most significant limb of
  406.      the result.
  407.      The destination has to have space for SRC1_SIZE + SRC1_SIZE limbs,
  408.      even if the result might be one limb smaller.
  409.      This function requires that SRC1_SIZE is greater than or equal to
  410.      SRC2_SIZE.  The destination must be distinct from either input
  411.      operands.
  412.  - Function: mp_size_t mpn_divrem (mp_limb_t * R1P, mp_size_t XSIZE,
  413.           mp_limb_t * RS2P, mp_size_t RS2SIZE, const mp_limb_t * S3P,
  414.           mp_size_t S3SIZE)
  415.      Divide {RS2P, RS2SIZE} by {S3P, S3SIZE}, and write the quotient at
  416.      R1P, with the exception of the most significant limb, which is
  417.      returned.  The remainder replaces the dividend at RS2P.
  418.      In addition to an integer quotient, XSIZE fraction limbs are
  419.      developed, and stored after the integral limbs.  For most usages,
  420.      XSIZE will be zero.
  421.      It is required that RS2SIZE is greater than or equal to S3SIZE.
  422.      It is required that the most significant bit of the divisor is set.
  423.      If the quotient is not needed, pass RS2P + S3SIZE as R1P.  Aside
  424.      from that special case, no overlap between arguments is permitted.
  425.      Return the most significant limb of the quotient, either 0 or 1.
  426.      The area at R1P needs to be RS2SIZE - S3SIZE + XSIZE limbs large.
  427.  - Function: mp_limb_t mpn_divrem_1 (mp_limb_t * R1P, mp_size_t XSIZE,
  428.           mp_limb_t * S2P, mp_size_t S2SIZE, mp_limb_t S3LIMB)
  429.      Divide {S2P, S2SIZE} by S3LIMB, and write the quotient at R1P.
  430.      Return the remainder.
  431.      In addition to an integer quotient, XSIZE fraction limbs are
  432.      developed, and stored after the integral limbs.  For most usages,
  433.      XSIZE will be zero.
  434.      The areas at R1P and S2P have to be identical or completely
  435.      separate, not partially overlapping.
  436.  - Function: mp_size_t mpn_divmod (mp_limb_t * R1P, mp_limb_t * RS2P,
  437.           mp_size_t RS2SIZE, const mp_limb_t * S3P, mp_size_t S3SIZE)
  438.      *This interface is obsolete.  It will disappear from future
  439.      releases.  Use `mpn_divrem' in its stead.*
  440.  - Function: mp_limb_t mpn_divmod_1 (mp_limb_t * R1P, mp_limb_t * S2P,
  441.           mp_size_t S2SIZE, mp_limb_t S3LIMB)
  442.      *This interface is obsolete.  It will disappear from future
  443.      releases.  Use `mpn_divrem_1' in its stead.*
  444.  - Function: mp_limb_t mpn_mod_1 (mp_limb_t * S1P, mp_size_t S1SIZE,
  445.           mp_limb_t S2LIMB)
  446.      Divide {S1P, S1SIZE} by S2LIMB, and return the remainder.
  447.  - Function: mp_limb_t mpn_preinv_mod_1 (mp_limb_t * S1P, mp_size_t
  448.           S1SIZE, mp_limb_t S2LIMB, mp_limb_t S3LIMB)
  449.      *This interface is obsolete.  It will disappear from future
  450.      releases.  Use `mpn_mod_1' in its stead.*
  451.  - Function: mp_limb_t mpn_bdivmod (mp_limb_t * DEST_PTR, mp_limb_t *
  452.           S1P, mp_size_t S1SIZE, const mp_limb_t * S2P, mp_size_t
  453.           S2SIZE, unsigned long int D)
  454.      The function puts the low [D/BITS_PER_MP_LIMB] limbs of Q = {S1P,
  455.      S1SIZE}/{S2P, S2SIZE} mod 2^D at DEST_PTR, and returns the high D
  456.      mod BITS_PER_MP_LIMB bits of Q.
  457.      {S1P, S1SIZE} - Q * {S2P, S2SIZE} mod 2^(S1SIZE*BITS_PER_MP_LIMB)
  458.      is placed at S1P.  Since the low [D/BITS_PER_MP_LIMB] limbs of
  459.      this difference are zero, it is possible to overwrite the low
  460.      limbs at S1P with this difference, provided DEST_PTR <= S1P.
  461.      This function requires that S1SIZE * BITS_PER_MP_LIMB >= D, and
  462.      that {S2P, S2SIZE} is odd.
  463.      *This interface is preliminary.  It might change incompatibly in
  464.      future revisions.*
  465.  - Function: mp_limb_t mpn_lshift (mp_limb_t * DEST_PTR, const
  466.           mp_limb_t * SRC_PTR, mp_size_t SRC_SIZE, unsigned long int
  467.           COUNT)
  468.      Shift {SRC_PTR, SRC_SIZE} COUNT bits to the left, and write the
  469.      SRC_SIZE least significant limbs of the result to DEST_PTR.  COUNT
  470.      might be in the range 1 to n - 1, on an n-bit machine. The bits
  471.      shifted out to the left are returned.
  472.      Overlapping of the destination space and the source space is
  473.      allowed in this function, provided DEST_PTR >= SRC_PTR.
  474.      This function is written in assembly for most targets.
  475.  - Function: mp_limp_t mpn_rshift (mp_limb_t * DEST_PTR, const
  476.           mp_limb_t * SRC_PTR, mp_size_t SRC_SIZE, unsigned long int
  477.           COUNT)
  478.      Shift {SRC_PTR, SRC_SIZE} COUNT bits to the right, and write the
  479.      SRC_SIZE most significant limbs of the result to DEST_PTR.  COUNT
  480.      might be in the range 1 to n - 1, on an n-bit machine.  The bits
  481.      shifted out to the right are returned.
  482.      Overlapping of the destination space and the source space is
  483.      allowed in this function, provided DEST_PTR <= SRC_PTR.
  484.      This function is written in assembly for most targets.
  485.  - Function: int mpn_cmp (const mp_limb_t * SRC1_PTR, const mp_limb_t *
  486.           SRC2_PTR, mp_size_t SIZE)
  487.      Compare {SRC1_PTR, SIZE} and {SRC2_PTR, SIZE} and return a
  488.      positive value if src1 > src2, 0 of they are equal, and a negative
  489.      value if src1 < src2.
  490.  - Function: mp_size_t mpn_gcd (mp_limb_t * DEST_PTR, mp_limb_t *
  491.           SRC1_PTR, mp_size_t SRC1_SIZE, mp_limb_t * SRC2_PTR,
  492.           mp_size_t SRC2_SIZE)
  493.      Puts at DEST_PTR the greatest common divisor of {SRC1_PTR,
  494.      SRC1_SIZE} and {SRC2_PTR, SRC2_SIZE}; both source operands are
  495.      destroyed by the operation.  The size in limbs of the greatest
  496.      common divisor is returned.
  497.      {SRC1_PTR, SRC1_SIZE} must be odd, and {SRC2_PTR, SRC2_SIZE} must
  498.      have at least as many bits as {SRC1_PTR, SRC1_SIZE}.
  499.      *This interface is preliminary.  It might change incompatibly in
  500.      future revisions.*
  501.  - Function: mp_limb_t mpn_gcd_1 (const mp_limb_t * SRC1_PTR, mp_size_t
  502.           SRC1_SIZE, mp_limb_t SRC2_LIMB)
  503.      Return the greatest common divisor of {SRC1_PTR, SRC1_SIZE} and
  504.      SRC2_LIMB, where SRC2_LIMB (as well as SRC1_SIZE) must be
  505.      different from 0.
  506.  - Function: mp_size_t mpn_gcdext (mp_limb_t * R1P, mp_limb_t * R2P,
  507.           mp_limb_t * S1P, mp_size_t S1SIZE, mp_limb_t * S2P, mp_size_t
  508.           S2SIZE)
  509.      Puts at R1P the greatest common divisor of {S1P, S1SIZE} and {S2P,
  510.      S2SIZE}.  The first cofactor is written at R2P.  Both source
  511.      operands are destroyed by the operation.  The size in limbs of the
  512.      greatest common divisor is returned.
  513.      *This interface is preliminary.  It might change incompatibly in
  514.      future revisions.*
  515.  - Function: mp_size_t mpn_sqrtrem (mp_limb_t * R1P, mp_limb_t * R2P,
  516.           const mp_limb_t * SP, mp_size_t SIZE)
  517.      Compute the square root of {SP, SIZE} and put the result at R1P.
  518.      Write the remainder at R2P, unless R2P is NULL.
  519.      Return the size of the remainder, whether R2P was NULL or non-NULL.
  520.      Iff the operand was a perfect square, the return value will be 0.
  521.      The areas at R1P and SP have to be distinct.  The areas at R2P and
  522.      SP have to be identical or completely separate, not partially
  523.      overlapping.
  524.      The area at R1P needs to have space for ceil(SIZE/2) limbs.  The
  525.      area at R2P needs to be SIZE limbs large.
  526.      *This interface is preliminary.  It might change incompatibly in
  527.      future revisions.*
  528.  - Function: mp_size_t mpn_get_str (unsigned char *STR, int BASE,
  529.           mp_limb_t * S1P, mp_size_t S1SIZE)
  530.      Convert {S1P, S1SIZE} to a raw unsigned char array in base BASE.
  531.      The string is not in ASCII; to convert it to printable format, add
  532.      the ASCII codes for `0' or `A', depending on the base and range.
  533.      There may be leading zeros in the string.
  534.      The area at S1P is clobbered.
  535.      Return the number of characters in STR.
  536.      The area at STR has to have space for the largest possible number
  537.      represented by a S1SIZE long limb array, plus one extra character.
  538.  - Function: mp_size_t mpn_set_str (mp_limb_t * R1P, const char *STR,
  539.           size_t strsize, int BASE)
  540.      Convert the raw unsigned char array at STR of length STRSIZE to a
  541.      limb array {S1P, S1SIZE}.  The base of STR is BASE.
  542.      Return the number of limbs stored in R1P.
  543.  - Function: unsigned long int mpn_scan0 (const mp_limb_t * S1P,
  544.           unsigned long int BIT)
  545.      Scan S1P from bit position BIT for the next clear bit.
  546.      It is required that there be a clear bit within the area at S1P at
  547.      or beyond bit position BIT, so that the function has something to
  548.      return.
  549.      *This interface is preliminary.  It might change incompatibly in
  550.      future revisions.*
  551.  - Function: unsigned long int mpn_scan1 (const mp_limb_t * S1P,
  552.           unsigned long int BIT)
  553.      Scan S1P from bit position BIT for the next set bit.
  554.      It is required that there be a set bit within the area at S1P at or
  555.      beyond bit position BIT, so that the function has something to
  556.      return.
  557.      *This interface is preliminary.  It might change incompatibly in
  558.      future revisions.*
  559.  - Function: void mpn_random2 (mp_limb_t * R1P, mp_size_t R1SIZE)
  560.      Generate a random number of length R1SIZE with long strings of
  561.      zeros and ones in the binary representation, and store it at R1P.
  562.      The generated random numbers are intended for testing the
  563.      correctness of the implementation of the `mpn' routines.
  564.  - Function: unsigned long int mpn_popcount (const mp_limb_t * S1P,
  565.           unsigned long int SIZE)
  566.      Count the number of set bits in {S1P, SIZE}.
  567.  - Function: unsigned long int mpn_hamdist (const mp_limb_t * S1P,
  568.           const mp_limb_t * S2P, unsigned long int SIZE)
  569.      Compute the hamming distance between {S1P, SIZE} and {S2P, SIZE}.
  570.  - Function: int mpn_perfect_square_p (const mp_limb_t * S1P, mp_size_t
  571.           SIZE)
  572.      Return non-zero iff {S1P, SIZE} is a perfect square.
  573. File: gmp.info,  Node: BSD Compatible Functions,  Next: Custom Allocation,  Prev: Low-level Functions,  Up: Top
  574. Berkeley MP Compatible Functions
  575. ********************************
  576.    These functions are intended to be fully compatible with the
  577. Berkeley MP library which is available on many BSD derived U*ix systems.
  578.    The original Berkeley MP library has a usage restriction: you cannot
  579. use the same variable as both source and destination in a single
  580. function call.  The compatible functions in GNU MP do not share this
  581. restriction--inputs and outputs may overlap.
  582.    It is not recommended that new programs are written using these
  583. functions.  Apart from the incomplete set of functions, the interface
  584. for initializing `MINT' objects is more error prone, and the `pow'
  585. function collides with `pow' in `libm.a'.
  586.    Include the header `mp.h' to get the definition of the necessary
  587. types and functions.  If you are on a BSD derived system, make sure to
  588. include GNU `mp.h' if you are going to link the GNU `libmp.a' to you
  589. program.  This means that you probably need to give the -I<dir> option
  590. to the compiler, where <dir> is the directory where you have GNU `mp.h'.
  591.  - Function: MINT * itom (signed short int INITIAL_VALUE)
  592.      Allocate an integer consisting of a `MINT' object and dynamic limb
  593.      space.  Initialize the integer to INITIAL_VALUE.  Return a pointer
  594.      to the `MINT' object.
  595.  - Function: MINT * xtom (char *INITIAL_VALUE)
  596.      Allocate an integer consisting of a `MINT' object and dynamic limb
  597.      space.  Initialize the integer from INITIAL_VALUE, a hexadecimal,
  598.      '\0'-terminate C string.  Return a pointer to the `MINT' object.
  599.  - Function: void move (MINT *SRC, MINT *DEST)
  600.      Set DEST to SRC by copying.  Both variables must be previously
  601.      initialized.
  602.  - Function: void madd (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  603.      Add SRC_1 and SRC_2 and put the sum in DESTINATION.
  604.  - Function: void msub (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  605.      Subtract SRC_2 from SRC_1 and put the difference in DESTINATION.
  606.  - Function: void mult (MINT *SRC_1, MINT *SRC_2, MINT *DESTINATION)
  607.      Multiply SRC_1 and SRC_2 and put the product in DESTINATION.
  608.  - Function: void mdiv (MINT *DIVIDEND, MINT *DIVISOR, MINT *QUOTIENT,
  609.           MINT *REMAINDER)
  610.  - Function: void sdiv (MINT *DIVIDEND, signed short int DIVISOR, MINT
  611.           *QUOTIENT, signed short int *REMAINDER)
  612.      Set QUOTIENT to DIVIDEND/DIVISOR, and REMAINDER to DIVIDEND mod
  613.      DIVISOR.  The quotient is rounded towards zero; the remainder has
  614.      the same sign as the dividend unless it is zero.
  615.      Some implementations of these functions work differently--or not
  616.      at all--for negative arguments.
  617.  - Function: void msqrt (MINT *OPERAND, MINT *ROOT, MINT *REMAINDER)
  618.      Set ROOT to the truncated integer part of the square root of
  619.      OPERAND.  Set REMAINDER to OPERAND-ROOT*ROOT, (i.e., zero if
  620.      OPERAND is a perfect square).
  621.      If ROOT and REMAINDER are the same variable, the results are
  622.      undefined.
  623.  - Function: void pow (MINT *BASE, MINT *EXP, MINT *MOD, MINT *DEST)
  624.      Set DEST to (BASE raised to EXP) modulo MOD.
  625.  - Function: void rpow (MINT *BASE, signed short int EXP, MINT *DEST)
  626.      Set DEST to BASE raised to EXP.
  627.  - Function: void gcd (MINT *OPERAND1, MINT *OPERAND2, MINT *RES)
  628.      Set RES to the greatest common divisor of OPERAND1 and OPERAND2.
  629.  - Function: int mcmp (MINT *OPERAND1, MINT *OPERAND2)
  630.      Compare OPERAND1 and OPERAND2.  Return a positive value if
  631.      OPERAND1 > OPERAND2, zero if OPERAND1 = OPERAND2, and a negative
  632.      value if OPERAND1 < OPERAND2.
  633.  - Function: void min (MINT *DEST)
  634.      Input a decimal string from `stdin', and put the read integer in
  635.      DEST.  SPC and TAB are allowed in the number string, and are
  636.      ignored.
  637.  - Function: void mout (MINT *SRC)
  638.      Output SRC to `stdout', as a decimal string.  Also output a
  639.      newline.
  640.  - Function: char * mtox (MINT *OPERAND)
  641.      Convert OPERAND to a hexadecimal string, and return a pointer to
  642.      the string.  The returned string is allocated using the default
  643.      memory allocation function, `malloc' by default.
  644.  - Function: void mfree (MINT *OPERAND)
  645.      De-allocate, the space used by OPERAND.  *This function should
  646.      only be passed a value returned by `itom' or `xtom'.*
  647. File: gmp.info,  Node: Custom Allocation,  Next: Contributors,  Prev: BSD Compatible Functions,  Up: Top
  648. Custom Allocation
  649. *****************
  650.    By default, the MP functions use `malloc', `realloc', and `free' for
  651. memory allocation.  If `malloc' or `realloc' fails, the MP library
  652. terminates execution after printing a fatal error message to standard
  653. error.
  654.    For some applications, you may wish to allocate memory in other
  655. ways, or you may not want to have a fatal error when there is no more
  656. memory available.  To accomplish this, you can specify alternative
  657. memory allocation functions.
  658.  - Function: void mp_set_memory_functions (
  659.           void *(*ALLOC_FUNC_PTR) (size_t),
  660.           void *(*REALLOC_FUNC_PTR) (void *, size_t, size_t),
  661.           void (*FREE_FUNC_PTR) (void *, size_t))
  662.      Replace the current allocation functions from the arguments.  If
  663.      an argument is NULL, the corresponding default function is
  664.      retained.
  665.      *Make sure to call this function in such a way that there are no
  666.      active MP objects that were allocated using the previously active
  667.      allocation function!  Usually, that means that you have to call
  668.      this function before any other MP function.*
  669.    The functions you supply should fit the following declarations:
  670.  - Function: void * allocate_function (size_t ALLOC_SIZE)
  671.      This function should return a pointer to newly allocated space
  672.      with at least ALLOC_SIZE storage units.
  673.  - Function: void * reallocate_function (void *PTR, size_t OLD_SIZE,
  674.           size_t NEW_SIZE)
  675.      This function should return a pointer to newly allocated space of
  676.      at least NEW_SIZE storage units, after copying at least the first
  677.      OLD_SIZE storage units from PTR.  It should also de-allocate the
  678.      space at PTR.
  679.      You can assume that the space at PTR was formerly returned from
  680.      `allocate_function' or `reallocate_function', for a request for
  681.      OLD_SIZE storage units.
  682.  - Function: void deallocate_function (void *PTR, size_t SIZE)
  683.      De-allocate the space pointed to by PTR.
  684.      You can assume that the space at PTR was formerly returned from
  685.      `allocate_function' or `reallocate_function', for a request for
  686.      SIZE storage units.
  687.    (A "storage unit" is the unit in which the `sizeof' operator returns
  688. the size of an object, normally an 8 bit byte.)
  689. File: gmp.info,  Node: Contributors,  Next: References,  Prev: Custom Allocation,  Up: Top
  690. Contributors
  691. ************
  692.    I would like to thank Gunnar Sjoedin and Hans Riesel for their help
  693. with mathematical problems, Richard Stallman for his help with design
  694. issues and for revising the first version of this manual, Brian Beuning
  695. and Doug Lea for their testing of early versions of the library.
  696.    John Amanatides of York University in Canada contributed the function
  697. `mpz_probab_prime_p'.
  698.    Paul Zimmermann of Inria sparked the development of GMP 2, with his
  699. comparisons between bignum packages.
  700.    Ken Weber (Kent State University, Universidade Federal do Rio Grande
  701. do Sul) contributed `mpz_gcd', `mpz_divexact', `mpn_gcd', and
  702. `mpn_bdivmod', partially supported by CNPq (Brazil) grant 301314194-2.
  703.    Per Bothner of Cygnus Support helped to set up MP to use Cygnus'
  704. configure.  He has also made valuable suggestions and tested numerous
  705. intermediary releases.
  706.    Joachim Hollman was involved in the design of the `mpf' interface,
  707. and in the `mpz' design revisions for version 2.
  708.    Bennet Yee contributed the functions `mpz_jacobi' and `mpz_legendre'.
  709.    Andreas Schwab contributed the files `mpn/m68k/lshift.S' and
  710. `mpn/m68k/rshift.S'.
  711.    The development of floating point functions of GNU MP 2, were
  712. supported in part by the ESPRIT-BRA (Basic Research Activities) 6846
  713. project POSSO (POlynomial System SOlving).
  714.    GNU MP 2 was finished and released by TMG Datakonsult,
  715. Sodermannagatan 5, 116 23 STOCKHOLM, SWEDEN, in cooperation with the
  716. IDA Center for Computing Sciences, USA.
  717. File: gmp.info,  Node: References,  Prev: Contributors,  Up: Top
  718. References
  719. **********
  720.    * Donald E. Knuth, "The Art of Computer Programming", vol 2,
  721.      "Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981.
  722.    * John D. Lipson, "Elements of Algebra and Algebraic Computing", The
  723.      Benjamin Cummings Publishing Company Inc, 1981.
  724.    * Richard M. Stallman, "Using and Porting GCC", Free Software
  725.      Foundation, 1995.
  726.    * Peter L. Montgomery, "Modular Multiplication Without Trial
  727.      Division", in Mathematics of Computation, volume 44, number 170,
  728.      April 1985.
  729.    * Torbjorn Granlund and Peter L. Montgomery, "Division by Invariant
  730.      Integers using Multiplication", in Proceedings of the SIGPLAN
  731.      PLDI'94 Conference, June 1994.
  732.    * Tudor Jebelean, "An algorithm for exact division", Journal of
  733.      Symbolic Computation, v. 15, 1993, pp. 169-180.
  734.    * Kenneth Weber, "The accelerated integer GCD algorithm", ACM
  735.      Transactions on Mathematical Software, v. 21 (March), 1995, pp.
  736.      111-122.
  737. File: gmp.info,  Node: Concept Index,  Up: Top
  738. Concept Index
  739. *************
  740. * Menu:
  741. * gmp.h:                                MP Basics.
  742. * mp.h:                                 BSD Compatible Functions.
  743. * Arithmetic functions <1>:             Float Arithmetic.
  744. * Arithmetic functions:                 Integer Arithmetic.
  745. * Bit manipulation functions:           Integer Logic and Bit Fiddling.
  746. * BSD MP compatible functions:          BSD Compatible Functions.
  747. * Comparison functions:                 Float Comparison.
  748. * Conditions for copying GNU MP:        Copying.
  749. * Conversion functions <1>:             Converting Integers.
  750. * Conversion functions:                 Converting Floats.
  751. * Copying conditions:                   Copying.
  752. * Float arithmetic functions:           Float Arithmetic.
  753. * Float assignment functions:           Assigning Floats.
  754. * Float comparisons functions:          Float Comparison.
  755. * Float functions:                      Floating-point Functions.
  756. * Float input and output functions:     I/O of Floats.
  757. * Floating-point functions:             Floating-point Functions.
  758. * Floating-point number:                MP Basics.
  759. * I/O functions <1>:                    I/O of Floats.
  760. * I/O functions:                        I/O of Integers.
  761. * Initialization and assignment functions <1>: Simultaneous Float Init & Assign.
  762. * Initialization and assignment functions: Simultaneous Integer Init & Assign.
  763. * Input functions <1>:                  I/O of Integers.
  764. * Input functions:                      I/O of Floats.
  765. * Installation:                         Installing MP.
  766. * Integer:                              MP Basics.
  767. * Integer arithmetic functions:         Integer Arithmetic.
  768. * Integer assignment functions:         Assigning Integers.
  769. * Integer conversion functions:         Converting Integers.
  770. * Integer functions:                    Integer Functions.
  771. * Integer input and output functions:   I/O of Integers.
  772. * Limb:                                 MP Basics.
  773. * Logical functions:                    Integer Logic and Bit Fiddling.
  774. * Low-level functions:                  Low-level Functions.
  775. * Miscellaneous float functions:        Miscellaneous Float Functions.
  776. * Miscellaneous integer functions:      Miscellaneous Integer Functions.
  777. * Output functions <1>:                 I/O of Floats.
  778. * Output functions:                     I/O of Integers.
  779. * Rational number:                      MP Basics.
  780. * Rational number functions:            Rational Number Functions.
  781. * Reporting bugs:                       Reporting Bugs.
  782. * User-defined precision:               Floating-point Functions.
  783.